import 'package:flutter/material.dart';

class SubTitleBar extends StatelessWidget {
  String _title;
  String _buttonDesc;
  var _onClick;
  SubTitleBar(this._title, this._buttonDesc,this._onClick);

  @override
  Widget build(BuildContext context) {
    return  Container(
      height: 48,
      decoration: BoxDecoration(
        color: Colors.white,
        border: new Border.all(width: 1, color: Colors.black38),
      ),
      width: double.infinity,
      child: Stack(
        children: [
          Align(
            alignment: Alignment.center,
            child: Text(
              "$_title",
              style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
            ),
          ),
          Align(
            alignment: Alignment.centerRight,
            child: Container(
              height: 30,
              margin: EdgeInsets.only(right: 8),
              child: OutlinedButton(
                onPressed: _onClick,
                child: Text("$_buttonDesc"),
              ),
            ),
          )
        ],
      ),
    );
  }
}
